const express = require('express');
const router = express.Router();
const {query} = require('../models/db');

router.get('/', async (req, res, next) => {
    try {
        const users = await query('SELECT * FROM sure.users');
        res.render('page/users',
            {title: '客户 - SURE后台管理系统', users}
        );
    } catch (err) {
        next(err);
    }
});

module.exports = router;
